//
//  BDJNewViewController.m
//  BuDeJie
//
//  Created by Guo Rui on 2017/9/19.
//  Copyright © 2017年 GR Harry. All rights reserved.
//

#import "BDJNewViewController.h"
#import "UIBarButtonItem+item.h"
#import "UITextField+Placeholer.h"

@interface BDJNewViewController ()

@end

@implementation BDJNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupNavBar];
    
    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 80, 100, 40)];
    [self.view addSubview:textField];
    
    textField.placeholderColor = [UIColor redColor];
    textField.placeholder = @"aaaa";
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabBarDidRepeatClick) name:BDJTabBarButtonDidRepeatClickNotification object:nil];
    
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    NSLog(@"\n************\n %@ dealloc \n************", self.class);
}

- (void)tabBarDidRepeatClick
{
    // 点击的不是精华分栏不应该响应
    if (!self.view.window) return;
    
    BDJFUNC
}
- (void)setupNavBar
{
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"MainTagSubIcon"] highlightImage:[UIImage imageNamed:@"MainTagSubIconClick"] target:self action:@selector(tag)];
    
    self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"MainTitle"]];
}

- (void)tag
{
    BDJLog(@"%s", __func__);
}

@end
